package util;

import android.content.Context;
import android.content.SharedPreferences;

/**
 * Created by Administrator on 2016/1/14.
 */
public class BaseUtil {
    public static boolean isLogin(Context mContext){
        SharedPreferences mPreferences = mContext.getSharedPreferences(
                "carData", mContext.MODE_PRIVATE);
        String token = mPreferences.getString("token","");
        return !BaseTools.isValueEmpty(token);
    }
    public static void setToken(Context mContext,String token){
        SharedPreferences mPreferences = mContext.getSharedPreferences(
                "carData", mContext.MODE_PRIVATE);
         mPreferences.edit().putString("token",token).commit();
    }
    public static String getToken(Context mContext){
        SharedPreferences mPreferences = mContext.getSharedPreferences(
                "carData", mContext.MODE_PRIVATE);
        return mPreferences.getString("token","");
    }
    public static void setQNToken(Context mContext,String token){
        SharedPreferences mPreferences = mContext.getSharedPreferences(
                "carData", mContext.MODE_PRIVATE);
        mPreferences.edit().putString("qniutoken",token).commit();
    }
    public static String getQNToken(Context mContext){
        SharedPreferences mPreferences = mContext.getSharedPreferences(
                "carData", mContext.MODE_PRIVATE);
        return mPreferences.getString("qniutoken","");
    }
}
